package com.cutefool.samples.transactional.scene02;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;


@Slf4j
@Service
public class Demo03Right {
    // @Transactional没有指定rollbackFor，默认只对RuntimeException和Error进行回滚。
    @Transactional(rollbackFor = Exception.class)
    public void m2() throws IOException {
        // doSomething
        throw new IOException();
    }
}
